
layui.use(["layer","laytpl","form"],function () {

    var layer = layui.layer,
        laytpl = layui.laytpl,
        $ = layui.$,
        form = layui.form;
        var html="<form class='layui-form' lay-filter='report'>\n" +
                    "<div class=\"layui-tab layui-tab-brief l-login-tab\">\n" +
                    "    <ul class=\"layui-tab-title\">\n" +
                    "        <li class=\"layui-this\">举报</li>\n" +
                    "    </ul>\n" +
                    "    <div class=\"layui-tab-content\">\n" +
                    "        <div class=\"layui-tab-item layui-show\">\n" +
                    "            <div class=\"layui-form-item c-ml15\">\n" +
                    "                <input type=\"radio\" name=\"type\" value=\"垃圾内容\" title=\"垃圾内容\" checked>\n" +
                    "                <input type=\"radio\" name=\"type\" value=\"淫秽色请\" title=\"淫秽色请\">\n" +
                    "                <input type=\"radio\" name=\"type\" value=\"其他理由\" title=\"其他理由\">\n" +
                    "            </div>\n" +
                    "            <div class=\"\">\n" +
                    "                <p>原因</p>\n" +
                    "                <textarea class=\"layui-textarea c-mtb15\" name='reason' style=\"resize: none; min-height: 80px\"></textarea>\n" +
                    "            </div>\n" +
                    "            <div class=\"c-mtb15\">\n" +
                    "                <button type=\"button\" lay-submit lay-filter=\"report-btn\" style=\"float: right;width: 100px\" class=\"layui-btn\">提交</button>\n" +
                    "            </div>\n" +
                    "        </div>\n" +
                    "    </div>\n" +
                    "</div>\n" +
                "</form>"
    $(".report").click(function () {
        var the = this,data = the.dataset;
        console.info(data);
        layer.open({
            type: 1,
            title: '',
            shade : 0.5,
            resize: false,
            area : ['400px','324px'],
            content:html,
            success: function () {
                form.val("report",{
                    type: "垃圾内容",
                    reason: "",
                })
                form.render()
                form.on('submit(report-btn)',function (data) {
                    console.info(data);
                })
            },
            end: function() {
            }
        });
    })
})